﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PraxisRent.Entities;
using PraxisRent.Repository;
using Microsoft.Practices.Unity;

namespace PraxisRent.BL
{
    public class CreditoBL:ICreditoBL
    {
        [Dependency]
        public ICreditoRepository creditoDAO { get; set; }

        public List<CREDITO> GetAllFromCredito()
        {
            return creditoDAO.GetAllFromCredito();
        }

        public List<CREDITO> GetAllFromCreditoByCliente(string criterio)
        {
            return creditoDAO.GetAllFromCreditoByCliente(criterio);
        }

        public List<CREDITO> GetAllFromCreditoByAlquiler(int codAlquiler)
        {
            return creditoDAO.GetAllFromCreditoByAlquiler(codAlquiler);
        }

        public CREDITO GetAllFromCreditoById(int id)
        {
            return creditoDAO.GetAllFromCreditoById(id);
        }

        public void AddCredito(CREDITO credito)
        {
            creditoDAO.AddCredito(credito);
        }

        public void UpdateCredito(CREDITO credito)
        {
            creditoDAO.UpdateCredito(credito);
        }
    }
}
